package client;

import java.awt.CardLayout;
import java.awt.Font;
import javax.swing.JFrame;
import javax.swing.JOptionPane;
import javax.swing.JPanel;
import javax.swing.UIManager;
import javax.swing.border.EmptyBorder;
import javax.swing.plaf.FontUIResource;

public class ScreenMATM extends JFrame {

	public static final String SCREENMENU = "SCREENMENU";
	public static final String SCREENLOGIN = "SCREENLOGIN";
	public static final String SCREENBALANCE = "SCREENBALANCE";
	public static final String DEPOSITFUNDS = "DEPOSITFUNDS";
	public static final String SENDBTC = "SENDBTC";

	private JPanel contentPane;
	private Screen_Login screenLogin;
	private Screen_Menu screenMenu;
	private Screen_Balance screenBalance;
	private Screen_Deposit screenDeposit;
	private Screen_SendBtc screenSendBtc;

	private CardLayout c;

	public ScreenMATM() {
		super("MATM BCBS 2013");
		setBackground(UIManager
				.getColor("TabbedPane.selectedTabTitlePressedColor"));
		setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
		setBounds(100, 100, 320, 480);
		contentPane = new JPanel();
		contentPane.setBackground(UIManager
				.getColor("TabbedPane.selectedTabTitlePressedColor"));
		contentPane.setBorder(new EmptyBorder(5, 5, 5, 5));
		setContentPane(contentPane);
		contentPane.setLayout(new CardLayout(0, 0));

		screenLogin = new Screen_Login();
		contentPane.add(screenLogin, "SCREENLOGIN");

		screenMenu = new Screen_Menu();
		contentPane.add(screenMenu, "SCREENMENU");

		screenBalance = new Screen_Balance();
		contentPane.add(screenBalance, "SCREENBALANCE");

		screenDeposit = new Screen_Deposit();
		contentPane.add(screenDeposit, "DEPOSITFUNDS");

		screenSendBtc = new Screen_SendBtc();
		contentPane.add(screenSendBtc, "SENDBTC");

		c = (CardLayout) getContentPane().getLayout();

	}

	public void showMessage(String message) {
		UIManager.put("OptionPane.messageFont", new FontUIResource(new Font(
				"Eurostile", Font.PLAIN, 12)));
		JOptionPane.showMessageDialog(this, message);

	}

	/**
	 * Returns contentPane
	 * 
	 * @return depositFunds
	 */
	public Screen_Deposit getScreen_Deposit() {
		return screenDeposit;
	}

	/**
	 * Returns contentPane
	 * 
	 * @return viewBalance
	 */
	public Screen_Balance getScreen_Balance() {
		return screenBalance;
	}

	/**
	 * Returns contentPane
	 * 
	 * @return customerMenu
	 */
	public Screen_Menu getScreen_Menu() {
		return screenMenu;
	}

	/**
	 * Returns contentPane
	 * 
	 * @return screenLogin
	 */
	public Screen_Login getScreen_Login() {
		return screenLogin;
	}

	/**
	 * Returns contentPane
	 * 
	 * @return screenSendBtc
	 */
	public Screen_SendBtc getScreen_SendBtc() {
		return screenSendBtc;
	}

	/**
	 * Show specific content pane
	 * 
	 * @param card
	 */
	public void Show(String card) {
		c.show(this.getContentPane(), card);
	}

}
